package cn.nawang.ebeim.api.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * TbDepartment entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "tb_department", catalog = "ebeim")
public class Department implements java.io.Serializable {

	// Fields

	private Integer id;
	private String name;
	private Integer parentId;
	private Short hasChildren;
	private Integer IOrder;
	private Integer level;
	private String createUserId;
	private Long createTime;
	private String lmUserId;
	private Long lmTime;
	private String customerId;
	
	private List<Department> children;

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	@GeneratedValue(strategy=GenerationType.AUTO)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "name", nullable = false, length = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "parent_id")
	public Integer getParentId() {
		return this.parentId;
	}

	public void setParentId(Integer parentId) {
		this.parentId = parentId;
	}

	@Column(name = "has_children")
	public Short getHasChildren() {
		return this.hasChildren;
	}

	public void setHasChildren(Short hasChildren) {
		this.hasChildren = hasChildren;
	}

	@Column(name = "i_order")
	public Integer getIOrder() {
		return this.IOrder;
	}

	public void setIOrder(Integer IOrder) {
		this.IOrder = IOrder;
	}

	@Column(name = "level")
	public Integer getLevel() {
		return this.level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	@Column(name = "create_user_id", nullable = false, length = 45)
	public String getCreateUserId() {
		return this.createUserId;
	}

	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId;
	}

	@Column(name = "create_time", nullable = false)
	public Long getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Long createTime) {
		this.createTime = createTime;
	}
	
	@Column(name = "lm_user_id", length = 45)
	public String getLmUserId() {
		return this.lmUserId;
	}

	public void setLmUserId(String lmUserId) {
		this.lmUserId = lmUserId;
	}

	@Column(name = "lm_time")
	public Long getLmTime() {
		return this.lmTime;
	}

	public void setLmTime(Long lmTime) {
		this.lmTime = lmTime;
	}

	@Column(name = "customer_id", nullable = false, length = 45)
	public String getCustomerId() {
		return this.customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}
	
	@Transient
    public List<Department> getChildren() {
        return this.children;
    }

    public void setChildren(List<Department> children) {
        this.children = children;
    }

    @Override
    public String toString() {
      return "Department [id=" + id + ", name=" + name + ", parentId=" + parentId + ", hasChildren="
          + hasChildren + ", IOrder=" + IOrder + ", level=" + level + ", createUserId="
          + createUserId + ", createTime=" + createTime + ", lmUserId=" + lmUserId + ", lmTime="
          + lmTime + ", customerId=" + customerId + ", children=" + children + "]";
    }
    
    

}